package com.lcb.acm;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Test0002 {
    public static void main(String[] args) throws IOException {

        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        String str = "";
        int[] a = new int[N];
        System.out.println("输入的数组的长度为" + a.length);
        //以下实现的是数组的输入
        //所用方法 利用字符输入流
        int num = 0;
        for (int i = 0; i < a.length; i++) {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            try {
                str = br.readLine();//读取读取文本行
                num = Integer.parseInt(str);// 将字符串参数作为有符号的十进制整数进行解析
            } catch (IOException e) {
                System.out.println(e.toString());
            }
            a[i] = num;
        }
//        for (int i = 0; i < a.length; i++) {
//            System.out.print(a[i] + " ");
//        }
        List<Integer> set = getSet(a);
        System.out.println(set);
    }

    public static List<Integer> getSet(int arr[]) {
        Set<Integer> set = new TreeSet<Integer>();

        for (int i = 0; i < arr.length; i++) {
            set.add(arr[i]);
        }
        List<Integer> list = new ArrayList<Integer>(set);
        return list;
    }
}
